home *** CD-ROM | disk | FTP | other *** search
/ Power Programmierung / Power-Programmierung (Tewi)(1994).iso / magazine / spoc88 / scrhnd / testprog.pro < prev    next >
Text File  |  1988-04-18  |  3KB  |  86 lines

  1. /*  Listing 4: TESTPROG.PRO  */
  2.  
  3.  /*******************************************************************
  4.                                                                   
  5.      Turbo Prolog Toolbox
  6.      (C) Copyright 1987 Borland International.                    
  7.                                                                   
  8.              HNDBASIS                  
  9.   This sample shows the minimum structure of a program using the  
  10.   screen handlers.                            
  11.  *******************************************************************/
  12.  
  13.  
  14.  
  15.  /*******************************************************************/
  16.  /*            Domains                        */
  17.  /*******************************************************************/
  18.  
  19. include "xtdoms.pro"
  20.  
  21. DOMAINS
  22.   FNAME=SYMBOL
  23.   TYPE = int(); str(); real()
  24.  
  25.  /*******************************************************************/
  26.  /*            Database predicates                */
  27.  /*******************************************************************/
  28.  
  29. DATABASE
  30.   /* Database declarations used in scrhnd */
  31.   insmode            /* Global insertmode */
  32.   actfield(FNAME)        /* Actual field */
  33.   screen(SYMBOL,DBASEDOM)    /* Saving different screens */
  34.   value(FNAME,STRING)        /* value of a field */
  35.   field(FNAME,TYPE,ROW,COL,LEN) /* Screen definition */
  36.   txtfield(ROW,COL,LEN,STRING)
  37.   windowsize(ROW,COL).
  38.   notopline
  39.  
  40.   /* DATABASE PREDICATES USED BY VSCRHND */
  41.   windowstart(ROW,COL)
  42.   mycursord(ROW,COL)
  43.  
  44.   /* Database declarations used in lineinp */
  45.   lineinpstate(STRING,COL)
  46.   lineinpflag
  47.  
  48.  
  49.  /*******************************************************************/
  50.  /*            Include tools                    */
  51.  /*******************************************************************/
  52.  
  53. include "xtpreds.pro"
  54. include "menu.pro"
  55. include "status.pro"
  56. include "lineinp.pro"
  57. include "xscrhnd.pro"    /* Or vscrhnd.pro */
  58.  
  59. CLAUSES
  60. /*******************************************************************
  61.             Field action
  62. *******************************************************************/
  63.  
  64.   field_action(_):-fail.
  65.   
  66. /*******************************************************************
  67.              Field_value
  68. *******************************************************************/
  69.  
  70.   field_value(FNAME,VAL):-value(FNAME,VAL),!.
  71.  
  72. /*******************************************************************
  73.              noinput
  74. *******************************************************************/
  75.  
  76.   noinput(_):-fail.
  77.  
  78.  
  79. GOAL
  80.       clearwindow,
  81.       consult("test.scr"),
  82.       createwindow(off),
  83.       scrhnd(off,EndKey),
  84.       removewindow,
  85.       write(EndKey).
  86.